<template>
  <el-dialog :title="model.title" :visible.sync="model.show" width="30%" :before-close="closeModel">
    <!-- 此处使用v-if重新渲染组件 -->
    <div v-if="model.show">
      <router-view></router-view>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: "RouterModal",
  data: function() {
    return {
      reFresh: true,
      model: {
        show: false,
        title: ""
      }
    };
  },

  methods: {
    openModel: function(title, path) {
      debugger;
      this.model.show = true;
      this.model.title = title;
      this.$router.push(path);
    },

    closeModel: function() {
      debugger;
      this.model.show = false;
    }
  }
};
</script>
